1. Field of The Invention
The present invention relates to a data stream output apparatus for sending out data coded in a specific style from a storage medium to a network More specifically, this invention concerns a data stream output apparatus for sending out data at a fixed ratexe2x80x94data which change in size with time.
2. Description of The Prior Art
Among the data which change in size with time is MPEG program stream data or video data
The MPEG video data including audio data is so designed that a group of pictures (GOP) (15 frames) of image data of three kindsxe2x80x94I, B and P picturesxe2x80x94makes up a unit of image data as illustrated in FIG. 3(b) (c). Also, as shown in FIG. 3(d), the video data of one GOP 303 is made up of a plurality of video packs Vp""s. Furthermore, a required number of audio packs ap""s are added to the plurality of video packs Vp""s to constitute a system stream SS as shown in FIG. 3(e).
At the pack header PH of each video pack in the system stream SS is written a system clock reference (SCR). This SCR serves as time base to control the timing for data to be handed over to an A/V separating means from a receive buffer on the terminal system side, which will be described below. Furthermore, each video pack is provided with a packet header KH. At each packet header KH are written a decoding time stamp (DTS) to serve as time base to control the decoding timing and a presentation time stamp (PTS) which is used as time base to regulate the display timing Each audio pack also has a pack header PH and a packet header KH.The packet header KH has PTS written in it. Furthermore, the top pack in each GOP is provided with a system header HS on which an identifier is written indicating the pack is at the top of the GOP. In practice, the DTS and PTS are written on packet headers as necessary depending on the types of I, B and P pictures, and not on all the packet headers.
In the MPEG program stream data thus configured, GOP""s are not uniform in data size. For example, the data size is small where there are not much changes with time, while the data size is large where much changes with time take place.
FIG. 18 is a conceptual diagram showing an example which adopts a push-type send method. This push-type send method sends out the MPEG program stream data unilaterally without paying regard to the conditions at the terminal. The disk unit 10a in the video server system 100 stores the MPEG program stream data thus built. The video data including audio data which is DMA transferred from the disk unit 10a to the send buffer 10b is sent out to the terminal system 1500 via the network 300. At the terminal system 1500, the video data obtained that way is temporarily stored in the receive buffer 1510 and then is referred to a decoder 1520 at a specific time interval to be decoded. The decoded data is then displayed by a display means 1530.
The above example presupposes that image data coded into MPEG program stream format has been stored in the disk unit 10a. Needless to say, image data which are not coded in MPEG program stream format and that are stored in the disk unit 10a may be encoded at the server system and sent out to the terminal.
FIG. 19 is a schematic illustration of a decoder 1520 provided in the terminal system 1500. Each GOP as unit of video data (including audio data) which is temporarily stored in the receive buffer 1510 is inputted in an audio-video (A/V) separating means 1521 from the receive buffer 1510 with the timing based on the system clock reference (SCR) of each pack There, the video pack Vp is separated from the audio pack ap and is then decoded by a video decoding means 1522 according to the aforesaid DTS and outputted to the display means 1530 by a display coordination means 1523 according to PTS. The audio data ap is converted into audio signal by an audio decoding means 1524 according to PTS.
The push-type transfer system sends out variable encoded data such as MPEG program stream data that changes with time once the server side is ready to send out data even if not solicited from the terminal. Hitherto, it has been a usual practice to send out stored data compressed irrespective of the encoding rate or the reproduction rate at the terminal. And it has often happened that too much data reached the terminal beyond the decoding rate, that is, the data consuming rate. In that system, the timing or the interval at which data is transferred from the receive buffer 1510 to the A/V separating means 1521 is based on the aforesaid system clock reference. In addition, GOP""s are different from each other in data size. Yet, the sending is always effected at a fixed rate determined on the basis of the capacity of the network So, it is often the case that data overflows the receive buffer 1510 before the decoding step at the terminal.
FIG. 15 is a time chart illustrating the shortcoming of the prior art in a conceptual manner. As described earlier (see FIG. 3), one unit of MPEG data, that is, a group of pictures (GOP) is made up of 15 frames that consist of image data of three kindsxe2x80x94I, B and P picturesxe2x80x94which constitute an image unit. One GOP unit is equivalent to 0.5 second of decoding or reproduction.
Now, let it be supposed that as MPEG data shown in FIG. 15(a) indicates in FIG. 15(b), the MPEG data is sent out from a server on to a network where data can be transmitted at a fixed rate of 4b/second. In this connection, the figuresxe2x80x940.5 secondsxe2x80x94given on the upper side of FIG. 15(a) indicate the decoding rate. Also, it should be presupposed that the terminal system 1500 shown in FIG. 16 has a receive buffer 1510 with a capacity of 8b and that if data transmitted and stored reaches 4b in size, MPEG data will be reproduced, that is, decoded by the MPEG decoder 1520. The outstanding data size or the remainder of data in the receive buffer 1510 is the total size of data inputted minus the total size of data decoded. The remainder changes with time as illustrated in FIG. 15(c) and overflows the receive buffer 1510 in six seconds, turning to an error.
To illustrate, 4b of data ((1), (2)) are received by the receive buffer 1510 for the first one second, when decoding starts. In the next one second, an additional 4b of data (up to the first 1b of (6)) are received, while the first 4b ((1) and (2)) are consumed. That leaves 4b of data in the receive buffer. In the next one second, 4b data (including the remaining 2b of (6)) are received, while 2b ((3), (4)) are consumed. That leaves 6b in the receive buffer. That way, the receive buffer overflows in 6 seconds.
Attempts have been made to avoid that trouble with the prior art push-type transfer system which include increased capacity of the receive buffer, provision of a function to monitor the excess or shortage of data coming in at the terminal and to issue to the server a request for change in data sending rate. But those measures did not work with a network in which packets are sent out at a very high rate and in a very short cycle as exemplified by isochronous transfer under IEEE 1394. In such a network even if the terminal requested the server to change the data sending rate, the request failed to be processed in time, resulting in overflowing Another possible solution to the problem was to change the original data, the whole MPEG program stream to an MPEG transport stream suitable for the push-type transfer all over.
As a solution to the problem an arrangement as shown in FIG. 17 is proposed in the unexamined Japanese patent application laid open under No. 9-46691. Under this arrangement, a data coded by an encoder 1401 is controlled by a write controller 1403 and first stored in an encoded data storage memory (buffer) 1042. Control information obtained from the encoder 1401 is also controlled by the write controller 1403 and is stored on a control information memory 1404. The encoded data thus written in by the write controller 1403 is to be sent out under the control of the read-out controller 1405 to the network via a dummy data adder 1406.
In the dummy data adder 1406, dummy data is added in such a quantity that the size of data to be sent out is fixed. That is, the size of data to be sent is made up of data from the encoded data storage memory 1402 and dummy data added in the size to offset the shortfall in the encoded datexe2x80x94the difference between the encoded data size and the fixed level. This way, the fixed data size is maintained.
In the method disclosed in the Japanese patent laid open publication No. 9-46691, though no consideration is given to control of the rate at which variable encoded data is written in the encoded data storage memory 1402, there arises no problem in processing data obtained from the encoder (real-time encoder). Generally, however, data is read out from storage media, such as hard disk and DVD, in blocks of a fixed size. If the arrangement in the conventional invention is applied to data obtained from a storage medium there is a possibility that the encoded data storage memory 1402 could be overflowed. That is because while the data output from the encoded data storage memory 1402 is synchronized with the data encoding rate, the writing in the buffer of data from the storage medium is time controlled. And the same trouble as illustrated in FIG. 15 occurs within the server.
It is also pointed out that the method of the Japanese patent laid open publication No. 9-46691 adds padding (dummy data) one after another while detecting the height of the encoding rate. The operation causes time loss. In addition, the shaped data has to be copied again on a DMA buffer for transfer to the network apparatus. This added time loss is a block to sending out data real-time.
The present invention addresses those problems. encountered with the prior art data stream (MPEG stream data for example) output apparatuses and data send methods. That is, it is an object of the present invention to provide a data stream output apparatus which can read out variable encoded data from such storage media as hard disk and DVD while maintaining continuity and permits push-type transfer to a network and that transfers data to a network system while efficiently shaping the data to a fixed size.
To achieve the object, the present invention is built on a data stream output apparatus which can read out data from a storage medium to an external device via a digital interface, the data stream including motion picture data encoded at variable bit rates.
In that data stream output apparatus, it is so arranged that a read buffer(pre-reading buffer 103) is provided for storing the data stream read from the storage medium, and a memory is provided for storing a time table Mt indicating the position and size (Sm) of the data block to be sent out to the external device every given period (f) in the data stream the data block including motion picture data to be decoded by the external device every given period (f). Further a send buffer 110 is provided for storing the data stream to be sent out to the external device via the digital interface.
According to the arrangement of the data stream output apparatus, a controller is provided for controlling the outputting of the data stream stored by the read buffer 103 from the send buffer 110 to the external device via digital interface, and the controller decides the data block to be sent out for the given period (f) of data stream stored by the read buffer 103 according to the time table Mt, transmits the decided data block from the read buffer 103 to the send buffer 110, adds padding data to the transmit data block so as to have a fixed size (K) when the size (Sm) of transmit data block is not equal to the fixed size (K) controls the outputting of the resultant data block from the send buffer 110 to the external device via the digital interface.
In this invention, the fixed size (K) is equal to the maximum permissible size (M) of the portion to be decoded every given period (f) in said data stream And the time table Mt indicates the position of said data block to be decoded in said data stream in terms of an offset value counting from the head of said data stream Further the data brocks are transmitted to a system provided with a decoder for said data stream via the digital interface.
It may be possible for the data stream output apparatus to further comprise a storage means for storing data stream inputted from outside on said storage medium an encoding means for encoding data inputted from outside into data stream at variable bit rates, and a time table generating means 406 for calculating the size of data required for decoding every given period (f) according to an encode parameter and generating said time table Mt on encoded data stream
It may be possible too for the data stream output apparatus to further comprise a storage means for storing data stream inputting from outside of said storage medium, and a time table generating means 406 which, if the data block inputted from outside is encoded data stream will calculate the size of data required for decoding every given period (f) according to an encode parameter and generate said time table Mt on encoded data stream
In the above description, the time table Mt is assumed to be created, but, even if there is not the time table Mt, this invention could come true according to the following arrangement. The arrangement is that, while the read buffer 103 stors the data stream read out from the storage medium the send buffer 103 stors the data stream to be sent to the digital interface.
According to the arrangement of the data stream output apparatus, a controller is provided a controller controlling the outputting of the data stream stored by the read buffer 103 from the send buffer 110 to the outside device via digital interface, and the controller calculates the position and size (Sm) of the portion to be decoded every given period (f) in the data stream decides the data block to be sent out for the given period (f) of data stream stored by the read buffer 103 on the basis of said calculated position and data size (Sm), adds padding data to the transmit data block so as to have a fixed size (K) when the size (Sm) of transmit data block is not equal to the fixed size (K) controls the outputting of the resultant data unit from the send buffer 110 to the external device via the digital interface.